{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
	<div class="main">
		{include admin.inc.menu}

		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				{include admin.inc.bread}

				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
					{loop $__sysmenus[$menu_key][subs] $k $v}
					<li{if $v[id]==$menu_id} class="active"{/if}><a href="{if $v[id]==$menu_id}javascript:;{else}/{$v[url]}{/if}"><i class="glyphicon glyphicon-th-list"></i> {$v[name]}</a></li>
					{/loop}
				</ul>

				<div class="inner-container">

					<!-- search form start -->
					<form class="form-inline form-search" role="form" id="search-form" autocomplete="off">
						<nav class="inline-form clearfix">
							<div class="r">
								<div class="form-group">
									<div class="input-group">
										<div class="input-group-addon">会员名称</div>
										<input type="text" name="username" value="{$params[username]}" class="form-control input-sm">
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<div class="input-group-addon">所属分类</div>
										<select class="form-control input-sm" name="typeid">
											<option value="">全部</option>
											{loop $types $val}
											<option value="{$val[id]}" {if $params[typeid]==$val[id]}selected{/if}>{$val[name]}</option>
											{/loop}
										</select>
									</div>
								</div>

								<button type="submit" class="btn btn-success btn-sm">
									<i class="glyphicon glyphicon-search"></i> 搜索</button>
							</div>
						</nav>

					</form><!-- END search form -->

					<form id="J_List_Form" autocomplete="off">
						<div class="table-responsive" style="overflow-x: visible;">
							<table class="table table-bordered table-hover" id="J_List_Table">
								<thead>
								<tr>
									<th width="20"><input type="checkbox" class="icheck check-all" /></th>
									{loop $tableHeader $val}
									<th>{$val}</th>
									{/loop}
								</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td class="no-records text-center">{$noRecords}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}" id="checkbox_row_{$value[id]}" /></td>
									<td><label for="checkbox_row_{$value[id]}">{$value[name]}</label></td>
									<td>{$value[brand]}</td>
									<td>{$value[factory]}</td>
									<td>{$value[typename]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[saas_user_name]}</td>

									<td>{$value[saas_user_username]}</td>

									<td>
										{if $value[ischecked] == 0}
										<span class="label label-default">未审核</span>
										{elseif $value[ischecked] == 1}
										<span class="label label-success" data-toggle="tooltip" data-placement="top" title="审核时间：{$value[checktime]}">已通过</span>
										{else}
										<span class="label label-danger" data-toggle="tooltip" data-placement="top" title="审核时间：{$value[checktime]}">不通过</span>
										{/if}
									</td>
								</tr>
								{/loop}
								</tbody>
							</table>
						</div>
					</form>

					<div class="text-right">
						{$pagemenu}
					</div>

				</div>

			</div><!-- end of inner -->
		</section>

	</div>
</div>

{include admin.inc.footer}

<script type="text/html" id="content-add-template">
	<form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span> 牌号名称</label>
				<input type="text" name="data[name]" value="{[item.name]}" class="form-control" maxlength="15" placeholder="牌号名称" required />
			</div>
			<p class="help-block">不超过15个字符</p>
		</div>

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span>  塑料种类</label>
				<select class="form-control select2" name="data[typeid]">
					{loop $types $value}
					<option value="{$value[id]}" {[if item.typeid == {$value[id]} ]}selected{[/if]}>{$value[name]}</option>
					{/loop}
				</select>
			</div>
			<p class="help-block"></p>
		</div>

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span>  品名</label>
				<select class="form-control select2" name="data[brandid]">
					{loop $brands $value}
					<option value="{$value[id]}" {[if item.brandid == {$value[id]} ]}selected{[/if]}>{$value[name]}</option>
					{/loop}
				</select>
			</div>
			<p class="help-block"></p>
		</div>

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span>  厂家名称</label>
				<select class="form-control select2" name="data[facid]">
					{loop $factorys $value}
					<option value="{$value[id]}" {[if item.facid == {$value[id]} ]}selected{[/if]}>{$value[name]}</option>
					{/loop}
				</select>
			</div>
			<p class="help-block"></p>
		</div>


		<div class="form-element">
			<div class="form-group">
				<label>审核状态</label>
				<div>
					<label class="icheck-label"><input type="radio" name="data[ischecked]" value="0" class="icheck" {[if item.ischecked == 0]}checked{[/if]}> 待审核</label>
					<label class="icheck-label"><input type="radio" name="data[ischecked]" value="1" class="icheck" {[if item.ischecked == 1]}checked{[/if]}> 已通过</label>
					<label class="icheck-label"><input type="radio" name="data[ischecked]" value="-1" class="icheck" {[if item.ischecked == -1]}checked{[/if]}> 不通过</label>
				</div>
			</div>
			<p class="help-block"></p>
		</div>


		<div class="form-element">
			<div class="form-group">
				<label>牌号状态</label>
				<div class="bootstrap-switch-swrap">
					<input type="checkbox" class="bswitch bswitch-list" data-size="mini" {[if item.status == 1]}checked{[/if]} data-on-text="启用" data-off-text="禁用">
					<input type="hidden" name="data[status]" value="{[item.status]}">
				</div>
			</div>
			<p class="help-block"></p>
		</div>

		<input type="hidden" name="id" value="{[item.id]}">
	</form>
</script>

<script>
	seajs.use("grade", function(exports) {
		exports.init({
			set_url : '/admin/grade/set/',
			insert_url : '{$insert_url}',
			edit_url : '{$edit_url}',
			update_url : '{$update_url}',
		});

		$('[data-toggle="tooltip"]').tooltip();
	});

</script>
</body>
</html>
